package com.jinzhi.jzweb.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.base.CoreServiceImpl;
import com.jinzhi.jzapi.certificate.pojo.MySignUpListVo;
import com.jinzhi.jzapi.certificate.pojo.NoDisStuListVo;
import com.jinzhi.jzweb.dao.StuSignUpDao;
import com.jinzhi.jzweb.domain.StuSignUpDO;
import com.jinzhi.jzweb.service.StuSignUpService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 
 * <pre>
 * 考生报名
 * </pre>
 * <small> 2020-02-24 21:00:11 | lance</small>
 */
@Service
public class StuSignUpServiceImpl extends CoreServiceImpl<StuSignUpDao, StuSignUpDO> implements StuSignUpService {

    @Override
    public Map<Object, Object> selCateFill(Map map) {
        return baseMapper.selCateFill(map);
    }

    @Override
    public Page<MySignUpListVo> selByUserId(int current, int number, Long userId) {

        // 新建分页
        Page<MySignUpListVo> page = new Page<MySignUpListVo>(current, number);

        // 根据情况，返回分页结果
        return page.setRecords(this.baseMapper.selByUserId(page,userId));
    }

    @Override
    public MySignUpListVo  selByUserTickNo(String ticket_number){
        return baseMapper.selByUserTickNo(ticket_number);
    }

    @Override
    public Double selByExamFee(Long signId){
        return baseMapper.selByExamFee(signId);
    }

    @Override
    public List<Map<Object,Object>> selByAll(){
        return baseMapper.selByAll();
    }

    @Override
    public StuSignUpDO selById(Long id) {
        return this.baseMapper.selById(id);
    }

    @Override
    public Integer selMaxNum(Map map){
        int  i = baseMapper.selMaxNum(map);
        return i;
    }


    @Override
    public Page<NoDisStuListVo> selNoDisStu(int current, int number, Long chatchId) {

        // 新建分页
        Page<NoDisStuListVo> page = new Page<NoDisStuListVo>(current, number);

        // 根据情况，返回分页结果
        return page.setRecords(this.baseMapper.selNoDisStu(page,chatchId));
    }

    @Override
    public int selNoReviewAll(){
        return this.baseMapper.selNoReviewAll();
    }

    @Override
    public int selNoReview(Long orgId){
        return this.baseMapper.selNoReview(orgId);
    }

    @Override
    public Page<Map<Object,Object>> selByNameCbatchId(int current, int number, Map map) {

        Page<Map<Object,Object>> page = new Page<>(current, number);
        return page.setRecords(this.baseMapper.selByNameCbatchId(page,map));
    }

    @Override
    public List<Map> selcbatchList(){
        return this.baseMapper.selcbatchList();
    }

    @Override
    public boolean selStuStateIfNull(Long chatchId){
        List<Long> longs = this.baseMapper.selStuStateIfNull(chatchId);
        if(longs != null && longs.size() > 0){
            return false;
        }else{
            return true;
        }
    }

    @Override
    public List<Long> selOrgStuAll(Long orgId){
        return baseMapper.selOrgStuAll(orgId);
    }
    
    @Override
    public List<String> selEroomId(String cbatchId,String orgId){
    	return baseMapper.selEroomId(cbatchId,orgId);
    }
}
